//
//  MyListTableViewCell.m
//  DA_V
//
//  Created by 中亿世联前台 on 15/4/23.
//  Copyright (c) 2015年 zhouhai. All rights reserved.
//

#import "MyListTableViewCell.h"
#import "ShoppingImageScrollView.h"
#import "UIViewAdditions.h"
#import "ShoppingImageView.h"
#import "InterFace.h"
#import "MyListNumView.h"
#import "NoZhiFu_View.h"


@implementation MyListTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {

        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        //订单号
        self.listNumber = (MyListNumView *)[[[NSBundle mainBundle] loadNibNamed:@"Shopping_list_xibs" owner:self options:nil] objectAtIndex:0];
        self.listNumber.frame = CGRectMake(0, 0, SCREEN_WIDTH, 80);;
        [self.contentView addSubview:self.listNumber];
        
        //线条
        UILabel *lineView = [[UILabel alloc] initWithFrame:CGRectMake(10, self.listNumber.bottom+5, SCREEN_WIDTH-20, 1)];
        lineView.backgroundColor = LineColor;
        
        [self.contentView addSubview:lineView];
        
        //去支付按钮
        self.state = [[UIButton alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-100, 20, 80, 30)];
        [self.state setBackgroundImage:[UIImage imageNamed:@"支付在线支付-客户_09"] forState:UIControlStateNormal];
        [self.state addTarget:self action:@selector(stateClick) forControlEvents:UIControlEventTouchUpInside];
        [self.contentView addSubview:self.state];
        
        //商品滑动图片

        
         CGRect rect = CGRectMake(0, self.listNumber.bottom+10 , SCREEN_WIDTH, 100);
        self.shoppingImageScrollView = [ShoppingImageScrollView  soppingImageScrollViewWithFrame:rect data:nil];
        self.shoppingImageScrollView.contentSize = CGSizeMake(SCREEN_WIDTH*2, 100);
        [self.contentView addSubview:self.shoppingImageScrollView];
        
        //线条
        UILabel *lineView2 = [[UILabel alloc] initWithFrame:CGRectMake(10, self.shoppingImageScrollView.bottom+5, SCREEN_WIDTH-20, 1)];
        lineView2.backgroundColor = LineColor;
        
        [self.contentView addSubview:lineView2];
        
        //订单状态
        self.nozhifuView = (NoZhiFu_View *)[[[NSBundle mainBundle] loadNibNamed:@"Shopping_list_xibs" owner:self options:nil] objectAtIndex:1];
        self.nozhifuView.frame = CGRectMake(0, lineView2.bottom, SCREEN_WIDTH, 55);
        [self.contentView addSubview:self.nozhifuView];
        
    }
    return self;
}


#pragma -mark 去支付

- (void)stateClick{
    
    [self.myListTableviewDelegate goZhiFuShoppingInfo:nil];
}


@end
